package com.warm.pump.module.work.dao.gen;

import java.util.List;
import java.util.Map;
import java.util.Date;
import java.math.BigDecimal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.frame.gen.util.TypeCast;
import com.warm.pump.frame.gen.exception.ServiceException;
import com.warm.pump.module.work.bean.po.gen.WorkParams;
import com.warm.pump.module.work.mapper.gen.WorkParamsMapper;
import com.warm.pump.module.work.bean.po.gen.WorkParamsExample;
@Repository
public class WorkParamsDao {
	// 日志对象
	private transient Log log = LogFactory.getLog(this.getClass());
	@Autowired
	private WorkParamsMapper workParamsMapper;

	// 增加一个后台WorkParams表
	
	public boolean insert(WorkParams workParams) {
		try {
			workParamsMapper.insert(workParams);
			log.debug("后台WorkParams表增加成功");
			return true;
		} catch (Exception e) {
			log.debug("后台WorkParams表增加失败");
			throw new ServiceException("后台WorkParams表增加失败",e);
		}
	}
	// 增加一个后台WorkParams表Selective
	
	public boolean insertSelective(WorkParams workParams) {
		try {
			workParamsMapper.insertSelective(workParams);
			log.debug("后台WorkParams表增加成功");
			return true;
		} catch (Exception e) {
			log.debug("后台WorkParams表增加失败");
			throw new ServiceException("后台WorkParams表增加失败",e);
		}
	}

	// 删除一个后台WorkParams表
	
	public boolean deleteByPrimaryKey(Long id) {
		try{
			workParamsMapper.deleteByPrimaryKey(id);
			log.debug("后台WorkParams表删除成功");
			return true;
		} catch(Exception e){
			log.debug("后台WorkParams表删除失败");
			throw new ServiceException("后台WorkParams表删除失败",e);
		}
	}
	// 删除一个后台WorkParams表byMap
	
	public boolean deleteByMap(Map workParamsMap) {
		try{
			workParamsMapper.deleteByExample(createWorkParamsExample(workParamsMap,null,null));
			log.debug("后台WorkParams根据Map删除成功");
			return true;
		}
		
		catch(Exception e){
			log.debug("后台WorkParams根据GroupID删除失败");
			throw new ServiceException("后台WorkParams根据object删除失败",e);
		}
	}
	// 修改一个后台WorkParams表
	
	public boolean updateByPrimaryKey(WorkParams workParams) {
		try{
			workParamsMapper.updateByPrimaryKey(workParams);
			log.debug("后台WorkParams表修改成功");
			return true;
		}
		
		catch(Exception e){
			log.debug("后台WorkParams表修改失败");
			throw new ServiceException("后台WorkParams表修改失败",e);
		}
	}
	// 修改一个后台WorkParams表Selective
	
	public boolean updateByPrimaryKeySelective(WorkParams workParams) {
		try{
			workParamsMapper.updateByPrimaryKeySelective(workParams);
			log.debug("后台WorkParams表修改成功");
			return true;
		}
		
		catch(Exception e){
			log.debug("后台WorkParams表修改失败");
			throw new ServiceException("后台WorkParams表修改失败",e);
		}
	}
	// 修改一个后台WorkParams表
	
	public boolean updateByMap(WorkParams workParams,Map workParamsMap) {
		try{
			workParamsMapper.updateByExample(workParams,createWorkParamsExample(workParamsMap,null,null));
			log.debug("后台批量WorkParams表修改成功");
			return true;
		}
		catch(Exception e){
			log.debug("后台批量WorkParams表修改失败");
			throw new ServiceException("后台WorkParams表批量修改失败",e);
		}
	}
	// 修改一个后台WorkParams表Selective
	
	public boolean updateByMapSelective(WorkParams workParams,Map workParamsMap) {
		try{
			workParamsMapper.updateByExampleSelective(workParams,createWorkParamsExample(workParamsMap,null,null));
			log.debug("后台批量WorkParams表修改成功");
			return true;
		}
		catch(Exception e){
			log.debug("后台批量WorkParams表修改失败");
			throw new ServiceException("后台WorkParams表批量修改失败",e);
		}
	}

	// 查询一个后台WorkParams表
	
	public WorkParams selectByPrimaryKey(Long id) {
		return workParamsMapper.selectByPrimaryKey(id);
	}
	
	// 查询一个后台WorkParams表-根据map
	
	public WorkParams selectByMap(Map workParamsMap) {
		List<WorkParams> list = getListByMap(workParamsMap);
		if(list==null||list.isEmpty()){
			return null;
		}else{
			return list.get(0);
		}
	}

	////////////////////////////////////////////////////////////////////////////////////////////////////////
	// 查询所有后台WorkParams表
	
	public List<WorkParams> getListByMap(Map workParamsMap) {
		
		return workParamsMapper.selectByExample(createWorkParamsExample(workParamsMap,null,null));
	}

	//统计后台WorkParams表数量
	
	public int countTotalByMap(Map workParamsMap) {
		
		return workParamsMapper.countByExample(createWorkParamsExample(workParamsMap,null,null));
	}

	
	public List<WorkParams> getListByMapPage(Map workParamsMap, int limitStart,
			int limitOffset) {
		
		return workParamsMapper.selectByExample(createWorkParamsExample(workParamsMap,limitStart,limitOffset));
	}
	
	
	public PageBean getPageBeanByMap(Map workParamsMap,int pageNo,int pageSize) {
		Integer count = countTotalByMap(workParamsMap);
		PageBean pageBean = new PageBean();
		pageBean.setCount(count);
		pageBean.setPageNo(pageNo);
		pageBean.setPageSize(pageSize);
		int limitStart = pageBean.getStartNo();
		int limitOffset = pageSize;
		pageBean.setData(workParamsMapper.selectByExample(createWorkParamsExample(workParamsMap,limitStart,limitOffset)));
		return pageBean;
	}
		
	private WorkParamsExample createWorkParamsExample(Map workParamsMap,Integer limitStart,Integer limitOffset){
			WorkParamsExample workParamsEx = new WorkParamsExample();
			WorkParamsExample.Criteria c = workParamsEx.createCriteria();
				Long id_null = TypeCast.getLong(workParamsMap.get("id_null"));
				Long id_notNull = TypeCast.getLong(workParamsMap.get("id_notNull"));
				Long id = TypeCast.getLong(workParamsMap.get("id"));
				Long id_not = TypeCast.getLong(workParamsMap.get("id_not"));
				Long id_greater = TypeCast.getLong(workParamsMap.get("id_greater"));
				Long id_greaterEqual = TypeCast.getLong(workParamsMap.get("id_greaterEqual"));
				Long id_less = TypeCast.getLong(workParamsMap.get("id_less"));
				Long id_lessEqual = TypeCast.getLong(workParamsMap.get("id_lessEqual"));
				List<Long> id_in = TypeCast.getLongList(workParamsMap.get("id_in"));
				List<Long> id_notIn = TypeCast.getLongList(workParamsMap.get("id_notIn"));
				Long id_between1 = TypeCast.getLong(workParamsMap.get("id_between1"));
				Long id_between2 = TypeCast.getLong(workParamsMap.get("id_between2"));
				Long id_notBetween1 = TypeCast.getLong(workParamsMap.get("id_notBetween1"));
				Long id_notBetween2 = TypeCast.getLong(workParamsMap.get("id_notBetween2"));
				
				if(id_null != null){
					c.andIdIsNull();
				}
				if(id_notNull != null){
					c.andIdIsNotNull();
				}
				if(id != null){
					c.andIdEqualTo(id);
				}
				if(id_not != null){
					c.andIdNotEqualTo(id_not);
				}
				if(id_greater != null){
					c.andIdGreaterThan(id_greater);
				}
				if(id_greaterEqual != null){
					c.andIdGreaterThanOrEqualTo(id_greaterEqual);
				}
				if(id_less != null){
					c.andIdLessThan(id_less);
				}
				if(id_lessEqual != null){
					c.andIdLessThanOrEqualTo(id_lessEqual);
				}
				if(id_in != null){
					c.andIdIn(id_in);
				}
				if(id_notIn != null){
					c.andIdNotIn(id_notIn);
				}
				if(id_between1 != null){
					c.andIdBetween(id_between1,id_between2);
				}
				if(id_notBetween1 != null){
					c.andIdNotBetween(id_notBetween1,id_notBetween2);
				}
				String belongType_null = TypeCast.getString(workParamsMap.get("belongType_null"));
				String belongType_notNull = TypeCast.getString(workParamsMap.get("belongType_notNull"));
				String belongType = TypeCast.getString(workParamsMap.get("belongType"));
				String belongType_not = TypeCast.getString(workParamsMap.get("belongType_not"));
				String belongType_greater = TypeCast.getString(workParamsMap.get("belongType_greater"));
				String belongType_greaterEqual = TypeCast.getString(workParamsMap.get("belongType_greaterEqual"));
				String belongType_less = TypeCast.getString(workParamsMap.get("belongType_less"));
				String belongType_lessEqual = TypeCast.getString(workParamsMap.get("belongType_lessEqual"));
				String belongType_like = TypeCast.getString(workParamsMap.get("belongType_like"));
				String belongType_notLike = TypeCast.getString(workParamsMap.get("belongType_notLike"));
				List<String> belongType_in = TypeCast.getStringList(workParamsMap.get("belongType_in"));
				List<String> belongType_notIn = TypeCast.getStringList(workParamsMap.get("belongType_notIn"));
				String belongType_between1 = TypeCast.getString(workParamsMap.get("belongType_between1"));
				String belongType_between2 = TypeCast.getString(workParamsMap.get("belongType_between2"));
				String belongType_notBetween1 = TypeCast.getString(workParamsMap.get("belongType_notBetween1"));
				String belongType_notBetween2 = TypeCast.getString(workParamsMap.get("belongType_notBetween2"));
				
				if(belongType_null != null){
					c.andBelongTypeIsNull();
				}
				if(belongType_notNull != null){
					c.andBelongTypeIsNotNull();
				}
				if(belongType != null){
					c.andBelongTypeEqualTo(belongType);
				}
				if(belongType_not != null){
					c.andBelongTypeNotEqualTo(belongType_not);
				}
				if(belongType_greater != null){
					c.andBelongTypeGreaterThan(belongType_greater);
				}
				if(belongType_greaterEqual != null){
					c.andBelongTypeGreaterThanOrEqualTo(belongType_greaterEqual);
				}
				if(belongType_less != null){
					c.andBelongTypeLessThan(belongType_less);
				}
				if(belongType_lessEqual != null){
					c.andBelongTypeLessThanOrEqualTo(belongType_lessEqual);
				}
				if(belongType_like != null){
					c.andBelongTypeLike(belongType_like);
				}
				if(belongType_notLike != null){
					c.andBelongTypeNotLike(belongType_notLike);
				}
				if(belongType_in != null){
					c.andBelongTypeIn(belongType_in);
				}
				if(belongType_notIn != null){
					c.andBelongTypeNotIn(belongType_notIn);
				}
				if(belongType_between1 != null){
					c.andBelongTypeBetween(belongType_between1,belongType_between2);
				}
				if(belongType_notBetween1 != null){
					c.andBelongTypeNotBetween(belongType_notBetween1,belongType_notBetween2);
				}
				Long belongId_null = TypeCast.getLong(workParamsMap.get("belongId_null"));
				Long belongId_notNull = TypeCast.getLong(workParamsMap.get("belongId_notNull"));
				Long belongId = TypeCast.getLong(workParamsMap.get("belongId"));
				Long belongId_not = TypeCast.getLong(workParamsMap.get("belongId_not"));
				Long belongId_greater = TypeCast.getLong(workParamsMap.get("belongId_greater"));
				Long belongId_greaterEqual = TypeCast.getLong(workParamsMap.get("belongId_greaterEqual"));
				Long belongId_less = TypeCast.getLong(workParamsMap.get("belongId_less"));
				Long belongId_lessEqual = TypeCast.getLong(workParamsMap.get("belongId_lessEqual"));
				List<Long> belongId_in = TypeCast.getLongList(workParamsMap.get("belongId_in"));
				List<Long> belongId_notIn = TypeCast.getLongList(workParamsMap.get("belongId_notIn"));
				Long belongId_between1 = TypeCast.getLong(workParamsMap.get("belongId_between1"));
				Long belongId_between2 = TypeCast.getLong(workParamsMap.get("belongId_between2"));
				Long belongId_notBetween1 = TypeCast.getLong(workParamsMap.get("belongId_notBetween1"));
				Long belongId_notBetween2 = TypeCast.getLong(workParamsMap.get("belongId_notBetween2"));
				
				if(belongId_null != null){
					c.andBelongIdIsNull();
				}
				if(belongId_notNull != null){
					c.andBelongIdIsNotNull();
				}
				if(belongId != null){
					c.andBelongIdEqualTo(belongId);
				}
				if(belongId_not != null){
					c.andBelongIdNotEqualTo(belongId_not);
				}
				if(belongId_greater != null){
					c.andBelongIdGreaterThan(belongId_greater);
				}
				if(belongId_greaterEqual != null){
					c.andBelongIdGreaterThanOrEqualTo(belongId_greaterEqual);
				}
				if(belongId_less != null){
					c.andBelongIdLessThan(belongId_less);
				}
				if(belongId_lessEqual != null){
					c.andBelongIdLessThanOrEqualTo(belongId_lessEqual);
				}
				if(belongId_in != null){
					c.andBelongIdIn(belongId_in);
				}
				if(belongId_notIn != null){
					c.andBelongIdNotIn(belongId_notIn);
				}
				if(belongId_between1 != null){
					c.andBelongIdBetween(belongId_between1,belongId_between2);
				}
				if(belongId_notBetween1 != null){
					c.andBelongIdNotBetween(belongId_notBetween1,belongId_notBetween2);
				}
				String paramKey_null = TypeCast.getString(workParamsMap.get("paramKey_null"));
				String paramKey_notNull = TypeCast.getString(workParamsMap.get("paramKey_notNull"));
				String paramKey = TypeCast.getString(workParamsMap.get("paramKey"));
				String paramKey_not = TypeCast.getString(workParamsMap.get("paramKey_not"));
				String paramKey_greater = TypeCast.getString(workParamsMap.get("paramKey_greater"));
				String paramKey_greaterEqual = TypeCast.getString(workParamsMap.get("paramKey_greaterEqual"));
				String paramKey_less = TypeCast.getString(workParamsMap.get("paramKey_less"));
				String paramKey_lessEqual = TypeCast.getString(workParamsMap.get("paramKey_lessEqual"));
				String paramKey_like = TypeCast.getString(workParamsMap.get("paramKey_like"));
				String paramKey_notLike = TypeCast.getString(workParamsMap.get("paramKey_notLike"));
				List<String> paramKey_in = TypeCast.getStringList(workParamsMap.get("paramKey_in"));
				List<String> paramKey_notIn = TypeCast.getStringList(workParamsMap.get("paramKey_notIn"));
				String paramKey_between1 = TypeCast.getString(workParamsMap.get("paramKey_between1"));
				String paramKey_between2 = TypeCast.getString(workParamsMap.get("paramKey_between2"));
				String paramKey_notBetween1 = TypeCast.getString(workParamsMap.get("paramKey_notBetween1"));
				String paramKey_notBetween2 = TypeCast.getString(workParamsMap.get("paramKey_notBetween2"));
				
				if(paramKey_null != null){
					c.andParamKeyIsNull();
				}
				if(paramKey_notNull != null){
					c.andParamKeyIsNotNull();
				}
				if(paramKey != null){
					c.andParamKeyEqualTo(paramKey);
				}
				if(paramKey_not != null){
					c.andParamKeyNotEqualTo(paramKey_not);
				}
				if(paramKey_greater != null){
					c.andParamKeyGreaterThan(paramKey_greater);
				}
				if(paramKey_greaterEqual != null){
					c.andParamKeyGreaterThanOrEqualTo(paramKey_greaterEqual);
				}
				if(paramKey_less != null){
					c.andParamKeyLessThan(paramKey_less);
				}
				if(paramKey_lessEqual != null){
					c.andParamKeyLessThanOrEqualTo(paramKey_lessEqual);
				}
				if(paramKey_like != null){
					c.andParamKeyLike(paramKey_like);
				}
				if(paramKey_notLike != null){
					c.andParamKeyNotLike(paramKey_notLike);
				}
				if(paramKey_in != null){
					c.andParamKeyIn(paramKey_in);
				}
				if(paramKey_notIn != null){
					c.andParamKeyNotIn(paramKey_notIn);
				}
				if(paramKey_between1 != null){
					c.andParamKeyBetween(paramKey_between1,paramKey_between2);
				}
				if(paramKey_notBetween1 != null){
					c.andParamKeyNotBetween(paramKey_notBetween1,paramKey_notBetween2);
				}
				Integer type_null = TypeCast.getInteger(workParamsMap.get("type_null"));
				Integer type_notNull = TypeCast.getInteger(workParamsMap.get("type_notNull"));
				Integer type = TypeCast.getInteger(workParamsMap.get("type"));
				Integer type_not = TypeCast.getInteger(workParamsMap.get("type_not"));
				Integer type_greater = TypeCast.getInteger(workParamsMap.get("type_greater"));
				Integer type_greaterEqual = TypeCast.getInteger(workParamsMap.get("type_greaterEqual"));
				Integer type_less = TypeCast.getInteger(workParamsMap.get("type_less"));
				Integer type_lessEqual = TypeCast.getInteger(workParamsMap.get("type_lessEqual"));
				List<Integer> type_in = TypeCast.getIntegerList(workParamsMap.get("type_in"));
				List<Integer> type_notIn = TypeCast.getIntegerList(workParamsMap.get("type_notIn"));
				Integer type_between1 = TypeCast.getInteger(workParamsMap.get("type_between1"));
				Integer type_between2 = TypeCast.getInteger(workParamsMap.get("type_between2"));
				Integer type_notBetween1 = TypeCast.getInteger(workParamsMap.get("type_notBetween1"));
				Integer type_notBetween2 = TypeCast.getInteger(workParamsMap.get("type_notBetween2"));
				
				if(type_null != null){
					c.andTypeIsNull();
				}
				if(type_notNull != null){
					c.andTypeIsNotNull();
				}
				if(type != null){
					c.andTypeEqualTo(type);
				}
				if(type_not != null){
					c.andTypeNotEqualTo(type_not);
				}
				if(type_greater != null){
					c.andTypeGreaterThan(type_greater);
				}
				if(type_greaterEqual != null){
					c.andTypeGreaterThanOrEqualTo(type_greaterEqual);
				}
				if(type_less != null){
					c.andTypeLessThan(type_less);
				}
				if(type_lessEqual != null){
					c.andTypeLessThanOrEqualTo(type_lessEqual);
				}
				if(type_in != null){
					c.andTypeIn(type_in);
				}
				if(type_notIn != null){
					c.andTypeNotIn(type_notIn);
				}
				if(type_between1 != null){
					c.andTypeBetween(type_between1,type_between2);
				}
				if(type_notBetween1 != null){
					c.andTypeNotBetween(type_notBetween1,type_notBetween2);
				}
				String paramValue_null = TypeCast.getString(workParamsMap.get("paramValue_null"));
				String paramValue_notNull = TypeCast.getString(workParamsMap.get("paramValue_notNull"));
				String paramValue = TypeCast.getString(workParamsMap.get("paramValue"));
				String paramValue_not = TypeCast.getString(workParamsMap.get("paramValue_not"));
				String paramValue_greater = TypeCast.getString(workParamsMap.get("paramValue_greater"));
				String paramValue_greaterEqual = TypeCast.getString(workParamsMap.get("paramValue_greaterEqual"));
				String paramValue_less = TypeCast.getString(workParamsMap.get("paramValue_less"));
				String paramValue_lessEqual = TypeCast.getString(workParamsMap.get("paramValue_lessEqual"));
				String paramValue_like = TypeCast.getString(workParamsMap.get("paramValue_like"));
				String paramValue_notLike = TypeCast.getString(workParamsMap.get("paramValue_notLike"));
				List<String> paramValue_in = TypeCast.getStringList(workParamsMap.get("paramValue_in"));
				List<String> paramValue_notIn = TypeCast.getStringList(workParamsMap.get("paramValue_notIn"));
				String paramValue_between1 = TypeCast.getString(workParamsMap.get("paramValue_between1"));
				String paramValue_between2 = TypeCast.getString(workParamsMap.get("paramValue_between2"));
				String paramValue_notBetween1 = TypeCast.getString(workParamsMap.get("paramValue_notBetween1"));
				String paramValue_notBetween2 = TypeCast.getString(workParamsMap.get("paramValue_notBetween2"));
				
				if(paramValue_null != null){
					c.andParamValueIsNull();
				}
				if(paramValue_notNull != null){
					c.andParamValueIsNotNull();
				}
				if(paramValue != null){
					c.andParamValueEqualTo(paramValue);
				}
				if(paramValue_not != null){
					c.andParamValueNotEqualTo(paramValue_not);
				}
				if(paramValue_greater != null){
					c.andParamValueGreaterThan(paramValue_greater);
				}
				if(paramValue_greaterEqual != null){
					c.andParamValueGreaterThanOrEqualTo(paramValue_greaterEqual);
				}
				if(paramValue_less != null){
					c.andParamValueLessThan(paramValue_less);
				}
				if(paramValue_lessEqual != null){
					c.andParamValueLessThanOrEqualTo(paramValue_lessEqual);
				}
				if(paramValue_like != null){
					c.andParamValueLike(paramValue_like);
				}
				if(paramValue_notLike != null){
					c.andParamValueNotLike(paramValue_notLike);
				}
				if(paramValue_in != null){
					c.andParamValueIn(paramValue_in);
				}
				if(paramValue_notIn != null){
					c.andParamValueNotIn(paramValue_notIn);
				}
				if(paramValue_between1 != null){
					c.andParamValueBetween(paramValue_between1,paramValue_between2);
				}
				if(paramValue_notBetween1 != null){
					c.andParamValueNotBetween(paramValue_notBetween1,paramValue_notBetween2);
				}
				String dbKey_null = TypeCast.getString(workParamsMap.get("dbKey_null"));
				String dbKey_notNull = TypeCast.getString(workParamsMap.get("dbKey_notNull"));
				String dbKey = TypeCast.getString(workParamsMap.get("dbKey"));
				String dbKey_not = TypeCast.getString(workParamsMap.get("dbKey_not"));
				String dbKey_greater = TypeCast.getString(workParamsMap.get("dbKey_greater"));
				String dbKey_greaterEqual = TypeCast.getString(workParamsMap.get("dbKey_greaterEqual"));
				String dbKey_less = TypeCast.getString(workParamsMap.get("dbKey_less"));
				String dbKey_lessEqual = TypeCast.getString(workParamsMap.get("dbKey_lessEqual"));
				String dbKey_like = TypeCast.getString(workParamsMap.get("dbKey_like"));
				String dbKey_notLike = TypeCast.getString(workParamsMap.get("dbKey_notLike"));
				List<String> dbKey_in = TypeCast.getStringList(workParamsMap.get("dbKey_in"));
				List<String> dbKey_notIn = TypeCast.getStringList(workParamsMap.get("dbKey_notIn"));
				String dbKey_between1 = TypeCast.getString(workParamsMap.get("dbKey_between1"));
				String dbKey_between2 = TypeCast.getString(workParamsMap.get("dbKey_between2"));
				String dbKey_notBetween1 = TypeCast.getString(workParamsMap.get("dbKey_notBetween1"));
				String dbKey_notBetween2 = TypeCast.getString(workParamsMap.get("dbKey_notBetween2"));
				
				if(dbKey_null != null){
					c.andDbKeyIsNull();
				}
				if(dbKey_notNull != null){
					c.andDbKeyIsNotNull();
				}
				if(dbKey != null){
					c.andDbKeyEqualTo(dbKey);
				}
				if(dbKey_not != null){
					c.andDbKeyNotEqualTo(dbKey_not);
				}
				if(dbKey_greater != null){
					c.andDbKeyGreaterThan(dbKey_greater);
				}
				if(dbKey_greaterEqual != null){
					c.andDbKeyGreaterThanOrEqualTo(dbKey_greaterEqual);
				}
				if(dbKey_less != null){
					c.andDbKeyLessThan(dbKey_less);
				}
				if(dbKey_lessEqual != null){
					c.andDbKeyLessThanOrEqualTo(dbKey_lessEqual);
				}
				if(dbKey_like != null){
					c.andDbKeyLike(dbKey_like);
				}
				if(dbKey_notLike != null){
					c.andDbKeyNotLike(dbKey_notLike);
				}
				if(dbKey_in != null){
					c.andDbKeyIn(dbKey_in);
				}
				if(dbKey_notIn != null){
					c.andDbKeyNotIn(dbKey_notIn);
				}
				if(dbKey_between1 != null){
					c.andDbKeyBetween(dbKey_between1,dbKey_between2);
				}
				if(dbKey_notBetween1 != null){
					c.andDbKeyNotBetween(dbKey_notBetween1,dbKey_notBetween2);
				}
				Date createTime_null = TypeCast.getDate(workParamsMap.get("createTime_null"));
				Date createTime_notNull = TypeCast.getDate(workParamsMap.get("createTime_notNull"));
				Date createTime = TypeCast.getDate(workParamsMap.get("createTime"));
				Date createTime_not = TypeCast.getDate(workParamsMap.get("createTime_not"));
				Date createTime_greater = TypeCast.getDate(workParamsMap.get("createTime_greater"));
				Date createTime_greaterEqual = TypeCast.getDate(workParamsMap.get("createTime_greaterEqual"));
				Date createTime_less = TypeCast.getDate(workParamsMap.get("createTime_less"));
				Date createTime_lessEqual = TypeCast.getDate(workParamsMap.get("createTime_lessEqual"));
				List<Date> createTime_in = TypeCast.getDateList(workParamsMap.get("createTime_in"));
				List<Date> createTime_notIn = TypeCast.getDateList(workParamsMap.get("createTime_notIn"));
				Date createTime_between1 = TypeCast.getDate(workParamsMap.get("createTime_between1"));
				Date createTime_between2 = TypeCast.getDate(workParamsMap.get("createTime_between2"));
				Date createTime_notBetween1 = TypeCast.getDate(workParamsMap.get("createTime_notBetween1"));
				Date createTime_notBetween2 = TypeCast.getDate(workParamsMap.get("createTime_notBetween2"));
				
				if(createTime_null != null){
					c.andCreateTimeIsNull();
				}
				if(createTime_notNull != null){
					c.andCreateTimeIsNotNull();
				}
				if(createTime != null){
					c.andCreateTimeEqualTo(createTime);
				}
				if(createTime_not != null){
					c.andCreateTimeNotEqualTo(createTime_not);
				}
				if(createTime_greater != null){
					c.andCreateTimeGreaterThan(createTime_greater);
				}
				if(createTime_greaterEqual != null){
					c.andCreateTimeGreaterThanOrEqualTo(createTime_greaterEqual);
				}
				if(createTime_less != null){
					c.andCreateTimeLessThan(createTime_less);
				}
				if(createTime_lessEqual != null){
					c.andCreateTimeLessThanOrEqualTo(createTime_lessEqual);
				}
				if(createTime_in != null){
					c.andCreateTimeIn(createTime_in);
				}
				if(createTime_notIn != null){
					c.andCreateTimeNotIn(createTime_notIn);
				}
				if(createTime_between1 != null){
					c.andCreateTimeBetween(createTime_between1,createTime_between2);
				}
				if(createTime_notBetween1 != null){
					c.andCreateTimeNotBetween(createTime_notBetween1,createTime_notBetween2);
				}
				Date updateTime_null = TypeCast.getDate(workParamsMap.get("updateTime_null"));
				Date updateTime_notNull = TypeCast.getDate(workParamsMap.get("updateTime_notNull"));
				Date updateTime = TypeCast.getDate(workParamsMap.get("updateTime"));
				Date updateTime_not = TypeCast.getDate(workParamsMap.get("updateTime_not"));
				Date updateTime_greater = TypeCast.getDate(workParamsMap.get("updateTime_greater"));
				Date updateTime_greaterEqual = TypeCast.getDate(workParamsMap.get("updateTime_greaterEqual"));
				Date updateTime_less = TypeCast.getDate(workParamsMap.get("updateTime_less"));
				Date updateTime_lessEqual = TypeCast.getDate(workParamsMap.get("updateTime_lessEqual"));
				List<Date> updateTime_in = TypeCast.getDateList(workParamsMap.get("updateTime_in"));
				List<Date> updateTime_notIn = TypeCast.getDateList(workParamsMap.get("updateTime_notIn"));
				Date updateTime_between1 = TypeCast.getDate(workParamsMap.get("updateTime_between1"));
				Date updateTime_between2 = TypeCast.getDate(workParamsMap.get("updateTime_between2"));
				Date updateTime_notBetween1 = TypeCast.getDate(workParamsMap.get("updateTime_notBetween1"));
				Date updateTime_notBetween2 = TypeCast.getDate(workParamsMap.get("updateTime_notBetween2"));
				
				if(updateTime_null != null){
					c.andUpdateTimeIsNull();
				}
				if(updateTime_notNull != null){
					c.andUpdateTimeIsNotNull();
				}
				if(updateTime != null){
					c.andUpdateTimeEqualTo(updateTime);
				}
				if(updateTime_not != null){
					c.andUpdateTimeNotEqualTo(updateTime_not);
				}
				if(updateTime_greater != null){
					c.andUpdateTimeGreaterThan(updateTime_greater);
				}
				if(updateTime_greaterEqual != null){
					c.andUpdateTimeGreaterThanOrEqualTo(updateTime_greaterEqual);
				}
				if(updateTime_less != null){
					c.andUpdateTimeLessThan(updateTime_less);
				}
				if(updateTime_lessEqual != null){
					c.andUpdateTimeLessThanOrEqualTo(updateTime_lessEqual);
				}
				if(updateTime_in != null){
					c.andUpdateTimeIn(updateTime_in);
				}
				if(updateTime_notIn != null){
					c.andUpdateTimeNotIn(updateTime_notIn);
				}
				if(updateTime_between1 != null){
					c.andUpdateTimeBetween(updateTime_between1,updateTime_between2);
				}
				if(updateTime_notBetween1 != null){
					c.andUpdateTimeNotBetween(updateTime_notBetween1,updateTime_notBetween2);
				}
			if(workParamsMap.get("orderBy")!=null){
				workParamsEx.setOrderByClause((String)workParamsMap.get("orderBy"));
			}
			if(limitStart != null && limitOffset != null){
				workParamsEx.setLimitStart(limitStart);
				workParamsEx.setLimitOffset(limitOffset);
			}
			
			return workParamsEx;
	}
}
